package org.ocean.general.sample.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectProvider;
import org.ocean.general.sample.conditional.Conditional;
import org.ocean.general.sample.page.PageInfo;
import org.ocean.general.sample.provider.SelectOptionalProvider;

import java.util.List;

public interface SelectMapper<T> {
    @SelectProvider(method = "selectList",type = SelectOptionalProvider.class)
    List<T> selectList();
    @SelectProvider(method = "selectByPrimaryKey",type = SelectOptionalProvider.class)
    T selectByPrimaryKey(@Param("key")Object key);
    @SelectProvider(method = "selectByConditional",type = SelectOptionalProvider.class)
    List<T> selectByConditional(@Param("conditional") Conditional conditional);
    @SelectProvider(method = "selectPageByConditional",type = SelectOptionalProvider.class)
    List<T> selectPageByConditional(@Param("pageInfo") PageInfo<T> pageInfo, @Param("conditional") Conditional conditional);
    @SelectProvider(method = "selectBetweenPageByPrimaryKey",type = SelectOptionalProvider.class)
    List<T> selectBetweenPageByPrimaryKey(@Param("pageInfo") PageInfo<T> pageInfo);
    @SelectProvider(method = "selectPageBySpecifyWhere",type = SelectOptionalProvider.class)
    List<T> selectPageBySpecifyWhere(@Param("pageInfo") PageInfo<T> pageInfo, @Param("conditional") Conditional conditional);
    @SelectProvider(method = "selectByIds",type = SelectOptionalProvider.class)
    List<T> selectByIds(@Param("ids")String[] ids);

    @SelectProvider(method = "selectByCount",type = SelectOptionalProvider.class)
    int selectByCount();
    @SelectProvider(method = "selectByConditionalCount",type = SelectOptionalProvider.class)
    int selectByConditionalCount(@Param("conditional") Conditional conditional);


}
